package com.five.admin.server;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.five.admin.dto.ProductEditDto;
import com.five.admin.dto.ProductQueryDto;
import com.five.admin.vo.ProductAdminVo;
import com.five.admin.vo.ProductDetailsVo;
import com.five.pojo.dto.ProductAddDto;
import com.five.pojo.entity.Product;
import com.five.pojo.vo.MobileProductListVo;
import org.hamcrest.core.Is;

import java.util.List;

public interface ProductService extends IService<Product> {
    int reduceStock(Long productId, Integer quantity);

    int increaseStock(Long productId, Integer quantity);

    Page<ProductAdminVo> findList(ProductQueryDto queryDto);

    /**
     * 增加产品
     * @param productAddDto
     * @return
     */
    boolean save(ProductAddDto productAddDto);

    ProductDetailsVo getById(Long id);

    /**
     * 查询相关分类下的商品
     * @return
     */
    List<MobileProductListVo> queryProductByCategoryId(Long categoryId);

    /**
     * 删除商品
     * @param id
     * @return
     */
    boolean deleteProductById(Long id);

    /**
     * 修改商品
     * @param productEditDto
     * @return
     */
    boolean updateProductById(ProductEditDto productEditDto);
}
